package com.godfrey.springcloud.config;

import org.springframework.cloud.config.server.environment.NativeEnvironmentProperties;
import org.springframework.cloud.config.server.environment.NativeEnvironmentRepository;
import org.springframework.cloud.config.server.environment.NativeEnvironmentRepositoryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置类
 *
 * @author godfrey
 * @since 2020-12-01
 */
@Configuration
public class ConfigBean {

    @Bean
    public NativeEnvironmentRepository
    nativeEnvironmentRepository(NativeEnvironmentRepositoryFactory factory,
                                NativeEnvironmentProperties environmentProperties) {
        return factory.build(environmentProperties);
    }
}
